<?php
Util::tsRegisterAssetJs('reacciones.js');

$this->menu = array(
    array('label' => Yii::t('AweCrud.app', 'Manage'), 'icon' => 'list-alt', 'url' => array('admin')),
);
?>
<div class="row-fluid">
    <?php
    $form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
        'type' => 'horizontal',
        'id' => 'ninio-reacciones-alimentarias-form',
        'enableAjaxValidation' => false,
        'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
        'enableClientValidation' => true,
    ));
    ?>


    <div class="span10">
        <?php
        $this->beginWidget('zii.widgets.CPortlet', array(
            'title' => ($model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Update')) . ' Reacciones Alimentarias ',
        ));
        ?>

        <div class="row-fluid">
            <div class="span5">
                <?php $this->renderPartial('portlets/detalle', array('model' => $model)) ?>
            </div>
            <?php echo $form->hiddenField($model, 'id'); ?>
            <?php echo $form->hiddenField($model, 'info_carta_semanal_id'); ?>
            <div class="span7">
                <?php
                $this->beginWidget('zii.widgets.CPortlet', array(
                    'title' => Yii::t('AweCrud.app', 'Ayudante'),
                ));
                ?>
                <p class="note">
                    <?php echo Yii::t('AweCrud.app', 'Fields with') ?>
                    <span class="required">*</span>
                    <?php echo Yii::t('AweCrud.app', 'are required') ?> 
                </p>

                <div>

                    <?php
                    echo $form->dropDownListRow($model, 'dia', array('' => ' -- Seleccione -- ', 'Lunes' => 'Lunes', 'Martes' => 'Martes', 'Miercoles' => 'Miercoles', 'Jueves' => 'Jueves', 'Viernes' => 'Viernes'), array(
                        'ajax' => array(
                            'type' => 'POST',
                            'url' => CController::createUrl('/ninio/NiniosInfoCartasemanal/cargarCartaNutricional'),
                            'update' => "#NiniosInfoCartasemanal_carta_nutricional_id",
                        ),
                    ));
                    ?>

                </div>
                <div>
                    <?php
                    echo $form->dropDownListRow($model, 'tiempo_comida', array('' => ' -- Seleccione -- ') + CHtml::listData(TipoCarta::model()->findAll(), 'id', TipoCarta::representingColumn()), array(
                        'ajax' => array(
                            'type' => 'POST',
                            'url' => CController::createUrl('/ninio/NiniosInfoCartasemanal/cargarCartaNutricional'),
                            'update' => "#NiniosInfoCartasemanal_carta_nutricional_id",
                        ),
                    ))
                    ?>
                </div>
                <?php $this->endWidget(); ?>
            </div>
        </div>
        <div class="row-fluid">
            <?php $this->renderPartial('portlets/alimentos_menu', array('form' => $form, 'model' => $model)) ?>
        </div>
        <div class="row-fluid" id="observaciones">
            <div class="span12">
                <?php echo $form->textAreaRow($model, 'observaciones') ?>
            </div>
        </div>

        <div class="form-actions">
            <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                'buttonType' => 'submit',
                'type' => 'primary',
                'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
            ));
            ?>
            <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                //'buttonType'=>'submit',
                'label' => Yii::t('AweCrud.app', 'Cancel'),
                'htmlOptions' => array('onclick' => 'javascript:history.go(-1)')
            ));
            ?>
        </div>


        <?php $this->endWidget(); ?>
    </div>
    <?php $this->endWidget(); ?>
    <div class="span2">
        <?php
        $this->beginWidget('zii.widgets.CPortlet', array(
            'title' => Yii::t('AweCrud.app', 'Operaciones'),
        ));
        $this->widget('zii.widgets.CMenu', array(
            'items' => $this->menu,
            'htmlOptions' => array('class' => 'operations'),
        ));
        ?>
        <?php $this->endWidget(); ?>
    </div>
</div>

